{% load i18n %}
<fieldset class="module aligned user">
	<h2>{% trans 'Profile' %}</h2>
	<div class="form-row">
		<span>{% trans 'Name' %}:</label>
		<span><strong>{{ cart.cart.user.get_full_name }}</strong></span>
	</div>
	<div class="form-row">
		<span>{% trans 'Address' %}</label>
		<span><strong>{{ cart.cart.user.get_profile.address }} {{ cart.cart.user.get_profile.postal }}</strong></span>
	</div>
	<div class="form-row">
		<span>{% trans 'Phone' %}</span>
		<span><strong>{{ cart.cart.user.get_profile.phone }}</strong></span>
	</div>
</fieldset>

<fieldset class="module aligned cart">
	<h2>{% trans 'Shoping Cart' %}</h2>
	{% if cart.items_count %}
		<table>
			<tr>
				<th>{% trans 'Product' %}</th>
				<th>{% trans 'Reference' %}</th>
				<th>{% trans 'Quantity' %}</th>
				<th>{% trans 'Unit price' %}</th>
				<th>{% trans 'Total Price' %}</th>
			</tr>
			{% for item in cart.items %}
			<tr{% if not forloop.first %} class="border"{% endif %}>
				<td>{{ item.object.translation.title }}</td>
				<td>{{ item.object.reference }}</td>
				<td>{{ item.quantity }}</td>
				<td>{{ item.unit_price|floatformat:2 }}&nbsp;EUR</td>
				<td>{{ item.total_price|floatformat:2 }}&nbsp;EUR</td>
			</tr>
			{% endfor%}
			<tr class="border total">
				<td colspan="3"></td>
				<td><strong>{% filter upper %}{% trans 'total' %}{% endfilter %}</strong></td>
				<td>{{ cart.total_price|floatformat:2 }}&nbsp;EUR</td>
			</tr>
		</table>
	{% else %}
		<p>{% trans 'no products in the shoping cart' %}</p>
	{% endif %}
</fieldset>
